'''
Created on 2009-11-23

@author: LiPengYu
'''

import cherrypy
from abio.util import template
from abio.util import session
import environment

class account(object):
    def __init__(self):
        pass
    
    @template.kid('./abio/sys/index.xhtml')
    def index(self, usr=None, pwd=None):
        return dict()
    
    @template.void
    def login(self, usr=None, pwd=None):
        if usr and pwd:
            session.set('user', usr)
            session.set('role', 'user')
            raise cherrypy.HTTPRedirect(environment.server['url']+'/file/index')            
        return None
            